package com.zheng.study.base.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * SQL 基类
 * ============================================================================
 * author : fallenpanda
 * createDate:  2018/5/22 。
 * ============================================================================
 */
@MappedSuperclass
public class BaseEntity implements Serializable {
	private static final long serialVersionUID = -3631355545221011266L;

	/**
	 * id
	 */
	protected String id;
//	/**
//	 * 创建时间
//	 */
//	protected Date createTime;
//	/**
//	 * 修改时间
//	 */
//	protected Date modifyTime;
//	/**
//	 * 创建时间戳
//	 */
//	protected String timestamp;
//
	@Id
	@Column(length = 32, nullable = false, unique = true)
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(name = "uuid", strategy = "uuid")
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
//
//	public Date getCreateTime() {
//		return createTime;
//	}
//
//	public void setCreateTime(Date createTime) {
//		this.createTime = createTime;
//	}
//
//	public Date getModifyTime() {
//		return modifyTime;
//	}
//
//	public void setModifyTime(Date modifyTime) {
//		this.modifyTime = modifyTime;
//	}
//
//	@Column(nullable = false, unique = true)
//	public String getTimestamp() {
//		return timestamp;
//	}
//
//	public void setTimestamp(String timestamp) {
//		this.timestamp = timestamp;
//	}
}
